import React, { Component } from 'react';
import { OrderApproveItem } from './_component/OrderApproveItem';
import { PayApproveItem } from './_component/PayApproveItem';
import { ChangeApproveItem } from './_component/ChangeApproveItem';
import { CreditApproveItem } from './_component/CreditApproveItem';
import { QHApproveItem } from './_component/QHApproveItem';
import { ZxycApproveItem } from './_component/ZxycApproveItem';

export class ApproveItemContainer extends Component {
	constructor(props) {
		super(props);
	}
	/*审批列表
		approveType  订单->O  付款申请->P  授信—>C  合同变更->A  长约变更->LC
	*/
	render() {
		const { itemInfo, approveType, dictKey, goDetail, choice, loadRefresh } = this.props;
		console.log('approveType', approveType)
		if (approveType === 'O') {
			return (
				<OrderApproveItem itemInfo={itemInfo} dictKey={dictKey} goDetail={goDetail} approveType={approveType} choice={choice} loadRefresh={loadRefresh} />
			)
		} else if (approveType === 'P') {
			return (
				<PayApproveItem itemInfo={itemInfo} dictKey={dictKey} goDetail={goDetail} approveType={approveType} choice={choice} />
			)
		} else if (approveType === 'C') {
			return (
				<CreditApproveItem itemInfo={itemInfo} dictKey={dictKey} goDetail={goDetail} approveType={approveType} choice={choice} />
			)
		} else if (approveType === 'A') {
			return (
				<ChangeApproveItem itemInfo={itemInfo} dictKey={dictKey} goDetail={goDetail} approveType={approveType} choice={choice} />
			)
		}
		else if (approveType === 'LC') {
			return (
				<ChangeApproveItem itemInfo={itemInfo} dictKey={dictKey} goDetail={goDetail} approveType={approveType} choice={choice} />
			)
		} else if (approveType === 'QH') {
			return (
				<QHApproveItem itemInfo={itemInfo} dictKey={dictKey} goDetail={goDetail} approveType={approveType} choice={choice} />
			)
		} else if (approveType === 'ZXYC') {
			return (
				<ZxycApproveItem itemInfo={itemInfo} dictKey={dictKey} goDetail={goDetail} approveType={approveType} choice={choice} />
			)
		} else {
			return null;
		}
	}
}